﻿CC = gcc
CFLAGS = -g3 -Wall -o1 -std=gnu99

CXX = g++
CXXFLAGS = -g3 -Wall -o1 -std=gnu++11

LDFLAGS =

TARGET = main.exe
RUN_ARGS = 3
OBJ = 
HEADERS = 

export OBJ HEADERS

-include subdir.mk

run : all
	@echo StartRunning: $(TARGET) with arg: $(RUN_ARGS)
	@./$(TARGET) $(RUN_ARGS)
	

all : $(TARGET) Makefile

%.o : %.cpp
	@echo Building File: $^
	@$(CXX) $(CXXFLAGS) $(HEADERS) -c -o $@ $^

%.o : %.c
	@echo Building File: $^
	@$(CC) $(CFLAGS) $(HEADERS) -c -o $@ $^

$(TARGET) : $(OBJ)
	@echo StartBuild: $(TARGET)
	@$(CXX) $(LDFLAGS) -o $(TARGET) $(OBJ)

clean:
	@echo $(OBJ)
	@del $(TARGET) $(OBJ)

.PHONY:all clean run

